home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992…ugust: Hack to the Future / ADC Developer CD (1992-08) (''Hack To The Future'')_iso / Dev.CD 199208.iso / Periodicals / develop / develop 9 code / Tracks / TestDrvr ƒ / makefile < prev    next >
Encoding:
Makefile  |  1992-01-06  |  2.1 KB  |  75 lines  |  [TEXT/MPS ]

  1. INITOBJECTS =     init.c.o ShowINIT.a.o
  2.                 
  3. # DriverGlue must be first for linker.
  4.  
  5. DRVROBJECTS =     DriverGlue.a.o    ∂
  6.                 drvr.c.o 
  7.  
  8. # Specify any options you want to pass to the compiler(s).  -b tells the compiler to
  9. # put strings in with the current segment, and not in the global data segment.
  10.  
  11. CPlusOptions = -b -mf
  12. COptions = -r -b 
  13.  
  14. #
  15. # Finally, the entire file consists of the DRVR, the INIT.  
  16. # These are included by sampdrvr.r, which simply includes the aforementioned resources...
  17. #
  18.  
  19. TestDrvr ƒƒ Init.rsrc drvr.rsrc testdrvr.h testdrvr.r
  20.     rez testdrvr.r -o TestDrvr
  21.     SetFile TestDrvr -c 'tstD' -t 'INIT' -a B
  22.     duplicate TestDrvr "{systemfolder}extensions:"TestDrvr -y
  23.      
  24. #
  25. ##################### Compile the INIT #####################
  26. #
  27. init.c.o    ƒ     init.c
  28.     C {COptions} init.c    -o init.c.o
  29.  
  30. ShowINIT.a.o    ƒ    ShowINIT.a
  31.     asm {AOptions} ShowINIT.a
  32.  
  33.     
  34. #
  35. ##################### Compile the DRVR #####################
  36. #
  37.  
  38. drvr.c.o    ƒ     testdrvr.h ∂
  39.                 drvr.c 
  40.     C {COptions} drvr.c    -o drvr.c.o
  41.  
  42. # Compile the assembly glue object.  Usual dependencies
  43. DriverGlue.a.o ƒ DriverGlue.a DriverGlue.incl.a
  44.     asm -case obj DriverGlue.a
  45.     
  46. #
  47. #
  48. # Link everything for the driver together.  -rt specifies the resource type.  
  49. # In this case, it's 'DRVR' with an ID of 0.  -m specifies which routine in the 
  50. # object files is the first one, so we tell it to look for the first one in the 
  51. # assembly file.  -sn renames the main segment to ".TestDrvr".  -ra is pretty 
  52. # self-explanatory, except you have to specify which segment(s) get the resource 
  53. # attributes.  
  54. #
  55.  
  56. drvr.rsrc ƒƒ {DRVROBJECTS}
  57.     Link -sg .TestDrvr -rt DRVR=0 -m HEADERDEF  -c 'RSED' -t 'rsrc' ∂
  58.         -ra ".TestDrvr"=resSysHeap,resLocked,resPreLoad ∂
  59.         {DRVROBJECTS} ∂
  60.         -o drvr.rsrc
  61.         
  62. #    
  63. # Link everything for the INIT together.  Not much here.  Much of the same options get
  64. # passed to the INIT linking as to the DRVR linking.  Again, only Interface.o needed.
  65.  
  66. Init.rsrc ƒƒ {INITOBJECTS} init.r 
  67.     Link -rt INIT=1 -m INITMAIN -sg INITMAIN -sn "Main=Install TestDrvr" ∂
  68.     -c 'RSED' -t 'rsrc' ∂
  69.         -ra InitSeg=resSysHeap,resLocked,resPreLoad ∂
  70.         init.c.o ∂
  71.         ShowINIT.a.o ∂
  72.         "{Libraries}"Interface.o ∂
  73.         -o Init.rsrc
  74.     rez init.r -a -o init.rsrc
  75.